/**
 * File:   Row.java
 * Author: Gvennet
 */
package dht.node;

import dht.identifier.identifier.Identifier;

/**
 * todo write javadoc
 */
public final class DHTDataRow
{

	private final Identifier id;

	private final String value;

	private long ttl;

	public DHTDataRow(Identifier id, String value, long ttl)
	{
		this.id = id;
		this.value = value;
		this.ttl = ttl;

	}

	public Identifier getId()
	{
		return id;
	}

	public String getValue()
	{
		return value;
	}


	public long getTtl()
	{
		return ttl;
	}

	public void setTtl(long ttl)
	{
		this.ttl = ttl;
	}

	public boolean equals(DHTDataRow compRow)
	{
		return id.compareTo(compRow.getId()) == 0 && value.equals(compRow.getValue()) && ttl == compRow.getTtl();
	}
}
